﻿using System;
using System.Collections.Generic;

namespace CommandDotNet.Prompts
{
    internal static class ConsoleKeys
    {
        internal static readonly HashSet<ConsoleKey> PassThroughKeys = new HashSet<ConsoleKey>()
        {
            ConsoleKey.Enter,
            ConsoleKey.Spacebar,
            ConsoleKey.Tab,
            ConsoleKey.A,
            ConsoleKey.B,
            ConsoleKey.C,
            ConsoleKey.D,
            ConsoleKey.E,
            ConsoleKey.F,
            ConsoleKey.G,
            ConsoleKey.H,
            ConsoleKey.I,
            ConsoleKey.J,
            ConsoleKey.K,
            ConsoleKey.L,
            ConsoleKey.M,
            ConsoleKey.N,
            ConsoleKey.O,
            ConsoleKey.P,
            ConsoleKey.Q,
            ConsoleKey.R,
            ConsoleKey.S,
            ConsoleKey.T,
            ConsoleKey.U,
            ConsoleKey.V,
            ConsoleKey.W,
            ConsoleKey.X,
            ConsoleKey.Y,
            ConsoleKey.Z,
            ConsoleKey.NumPad0,
            ConsoleKey.NumPad1,
            ConsoleKey.NumPad2,
            ConsoleKey.NumPad3,
            ConsoleKey.NumPad4,
            ConsoleKey.NumPad5,
            ConsoleKey.NumPad6,
            ConsoleKey.NumPad7,
            ConsoleKey.NumPad8,
            ConsoleKey.NumPad9,
            ConsoleKey.D0,
            ConsoleKey.D1,
            ConsoleKey.D2,
            ConsoleKey.D3,
            ConsoleKey.D4,
            ConsoleKey.D5,
            ConsoleKey.D6,
            ConsoleKey.D7,
            ConsoleKey.D8,
            ConsoleKey.D9,
            ConsoleKey.Oem1,
            ConsoleKey.Oem102,
            ConsoleKey.Oem2,
            ConsoleKey.Oem3,
            ConsoleKey.Oem4,
            ConsoleKey.Oem5,
            ConsoleKey.Oem6,
            ConsoleKey.Oem7,
            ConsoleKey.Oem8,
            ConsoleKey.OemComma,
            ConsoleKey.OemMinus,
            ConsoleKey.OemPeriod,
            ConsoleKey.OemPlus,
            ConsoleKey.Add,
            ConsoleKey.Divide,
            ConsoleKey.Multiply,
            ConsoleKey.Subtract,
            ConsoleKey.Decimal,
        };

        // Keeping the following two for reference.  At some point, DirectionKeys support may be implemented for current prompt

        private static readonly HashSet<ConsoleKey> DirectionKeys = new HashSet<ConsoleKey>()
        {
            ConsoleKey.LeftArrow,
            ConsoleKey.Delete,
            ConsoleKey.DownArrow,
            ConsoleKey.End,
            ConsoleKey.Home,
            ConsoleKey.RightArrow,
            ConsoleKey.UpArrow,
        };

        private static readonly HashSet<ConsoleKey> IgnoredKeys = new HashSet<ConsoleKey>
        {
            ConsoleKey.Applications,
            ConsoleKey.Attention,
            ConsoleKey.BrowserBack,
            ConsoleKey.BrowserFavorites,
            ConsoleKey.BrowserForward,
            ConsoleKey.BrowserHome,
            ConsoleKey.BrowserRefresh,
            ConsoleKey.BrowserSearch,
            ConsoleKey.BrowserStop,
            ConsoleKey.CrSel,
            ConsoleKey.EraseEndOfFile,
            ConsoleKey.Execute,
            ConsoleKey.ExSel,
            ConsoleKey.F1,
            ConsoleKey.F10,
            ConsoleKey.F11,
            ConsoleKey.F12,
            ConsoleKey.F13,
            ConsoleKey.F14,
            ConsoleKey.F15,
            ConsoleKey.F16,
            ConsoleKey.F17,
            ConsoleKey.F18,
            ConsoleKey.F19,
            ConsoleKey.F2,
            ConsoleKey.F20,
            ConsoleKey.F21,
            ConsoleKey.F22,
            ConsoleKey.F23,
            ConsoleKey.F24,
            ConsoleKey.F3,
            ConsoleKey.F4,
            ConsoleKey.F5,
            ConsoleKey.F6,
            ConsoleKey.F7,
            ConsoleKey.F8,
            ConsoleKey.F9,
            ConsoleKey.Help,
            ConsoleKey.Insert,
            ConsoleKey.LaunchApp1,
            ConsoleKey.LaunchApp2,
            ConsoleKey.LaunchMail,
            ConsoleKey.LaunchMediaSelect,
            ConsoleKey.LeftWindows,
            ConsoleKey.MediaNext,
            ConsoleKey.MediaPlay,
            ConsoleKey.MediaPrevious,
            ConsoleKey.MediaStop,
            ConsoleKey.NoName,
            ConsoleKey.Pa1,
            ConsoleKey.Packet,
            ConsoleKey.PageDown,
            ConsoleKey.PageUp,
            ConsoleKey.Pause,
            ConsoleKey.Play,
            ConsoleKey.Print,
            ConsoleKey.PrintScreen,
            ConsoleKey.Process,
            ConsoleKey.RightWindows,
            ConsoleKey.Select,
            ConsoleKey.Separator,
            ConsoleKey.Sleep,
            ConsoleKey.VolumeDown,
            ConsoleKey.VolumeMute,
            ConsoleKey.VolumeUp,
            ConsoleKey.Zoom,
        };
    }
}